<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="middle padtop10 myclear">
	<div class="page-content">
		
		<!-- bread crumb -->
		<p id="bread-crumb">
			<a href="<?php echo base_url();?>">
				<?php echo $lang['home']?>
			</a>
			<a href="<?php echo site_url('monitor');?>">
				<?php echo $lang['monitor'];?>
			</a>
			<?php echo $lang['banner_nrun_list'];?>
		</p>
		<!-- end bread crumb -->
		<h3>
			<?php echo $lang['banner_nrun_list'];?>
		</h3>
		<br style="clear:both;" />
		<table class="tbl-list" width="100%" border="1">
			<tr>
				<td width="3%" class="td-label" style="text-align:center">
					<b>#</b>
				</td>
				<td class="td-label" width="20%">
					<b><?php echo $lang['user'];?></b>
				</td>
				<td class="td-label" width="17%">
					<b><?php echo $lang['campaign'];?></b>
				</td>
				<td width="25%" class="td-label">
					<b><?php echo $lang['banner'];?></b>
				</td>
				<td width="18%" class="td-label">
					<b><?php echo $lang['target'];?></b>
				</td>
				<td class="td-label">
					<b><?php echo $lang['date'];?></b>
				</td>
			</tr>
			<?php $i = 0; foreach ($items as $item){ $i++; ?>
			<tr class="row">
				<td style="text-align:center">
					<?php echo ($stt + $i);?>
				</td>
                <td>
					<p>
						<?php echo $lang['user'].': <b>'.$item->username.'</b>';?>
					</p>
					<p>
						<?php echo $lang['fullname'].': '.$item->contact_name;?>
					</p>
					<p>
						<?php echo $lang['email'].': '.$item->email_address;?>
					</p>
					<p>
						<?php echo $lang['phone'].': '.$item->phone;?>
					</p>
				</td>
				<td>
					<p>
						<?php echo '<b>'.$item->campaignname.'</b>';?>
					</p>
					<!--
					<p>
						<?php echo $lang['budget'].': '.($item->typebudget == 0 ? $lang['to_campaign'] : $lang['to_day']);?>
					</p>
					<p>
						<?php echo $lang['max_value_day'].': '.number_format($item->maxValueDay).$lang['currency'];?>
					</p>
					<p>
						<?php echo $lang['expire_value'].': '.number_format($item->ExpireValue).$lang['currency'];?>
					</p>
					-->
					<?php
					echo $lang['budget'].': ';
					if($item->typebudget == 0)
						echo number_format($item->ExpireValue).$lang['currency'].' '.$lang['to_campaign'];
					else
						echo number_format($item->maxValueDay).$lang['currency'].' '.$lang['to_day'];
					?>
				</td>
				<td>
					<table width="100%" border="0" class="banner-format">
						<tr>
							<td colspan="2">
                            	<b><?php echo $item->bannername;?></b>
                                <p style="color:#999"><?php echo $this->mycommon->getDomainFromUrl($item->url);?></p>
                            </td>
						</tr>
                        <tr>
                        	<td width="90">
                            	<img src="<?php echo $this->mycommon->getBannerImagPath('','',$item->filename,strtotime($item->createtime));?>" border="0" class="ibanner" />
                            </td>
                            <td>
                            	<?php echo $item->bannertext;?>
                            </td>
                        </tr>
					</table>
				</td>
				<td>
					<p>
						<?php echo '<b>'.$lang['location'].'</b>: '.$this->mycommon->checkLocation($item->locationAd,$arrLocation);?>
					</p>
					<p>
						<?php echo '<b>'.$lang['list_site'].'</b>: '.str_replace(',',', ',$item->list_site);?>
					</p>
				</td>
				<td>
					<?php echo date('d-m-Y', strtotime($item->startdate)).$lang['to'].date('d-m-Y', strtotime($item->enddate));?>
				</td>
			</tr>
			<?php }?>
		</table>
        <!-- paging -->
        <div class="myclear martop20">
            <div class="brv-paging-left">
                <table class="tbl-list brv-paging" border="1">
                    <tr>
                        <td class="brv-paging-name">
                            <?php echo $lang['page'].' '. $page.' ['.$pages.']'?>
                        </td>
                        
                        <td class="brv-paging-pre-next">
                            <img class="brv-img-pre" alt="previous" src="/images/imgpre.gif" onclick="goPage(<?php echo $page > 1 ? $page - 1 : $page;?>)" />
                            <img class="brv-img-next" alt="next" src="/images/imgnext.gif" onclick="goPage(<?php echo $page < $pages ? $page + 1 : $page;?>)" />
                        </td>
                    </tr>
                </table>
            </div>
            <!-- important. fix for ie 6. Don't remove -->
            <!--[if IE 6]><br class="clearboth" /><![endif]-->
        </div>
        <!-- end paging -->
	</div>
</div><br />
<script type="text/javascript">
$(document).ready(function(){
	$('.tbl-list .row').mouseover(function(){
		$(this).css('background','#ffc');
	});
	$('.tbl-list .row').mouseout(function(){
		$(this).css('background','none');
	});
});
function goPage(strVal)
{
	window.location.href = '<?php echo site_url('monitor/bannerNotRunList');?>/?page=' + strVal;
}
</script>